package cn.xdf.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;


@Controller//处理器类
public class Demo01Controller {

    @RequestMapping("/demo01")//访问路径写两个就访问两次 //method
    public ModelAndView modelAndView(){  //hander--》找hander，就是method找到方法就执行

        ModelAndView mv=new ModelAndView();
        mv.addObject("message","hello SpringMVC");//添加一个视图
        mv.setViewName("/test01.jsp"); //跳转到test01
        return mv;

    }


}
